
from Products.CMFPlone.UnicodeSplitter import Splitter as BaseSplitter

from UnicodeSplitter import to_unicode, enc, bigrams
def process(self, lst, glob=0):
    ulst = (to_unicode(t) for t in lst)
    return [t.encode(enc, 'replace') for t in bigrams(ulst, glob)]

def processGlob(self, lst):
    return self.process(lst, 1)

BaseSplitter.meta_type = 'BigramSplitter'
BaseSplitter.process = process
BaseSplitter.processGlob = processGlob

